1. Field of the Invention
The present invention relates to a method and apparatus of handling data decryption in a wireless communication system, and more particularly, to a method and apparatus of handling data decryption for a packet data convergence protocol layer of a user equipment upon handover in a wireless communication system.
2. Description of the Prior Art
The third generation mobile telecommunications system (called 3G system) provides high frequency spectrum utilization, universal coverage, and high quality, high-speed multimedia data transmission, and also meets all kinds of QoS requirements simultaneously, providing diverse, flexible, two-way transmission services and better communication quality to reduce transmission interruption rates. However, due to demand for high-speed and multimedia applications, the next generation mobile telecommunications technology and related communication protocols have been developed.
Long Term Evolution wireless communications system (LTE system), an advanced high-speed wireless communications system established upon the 3G mobile telecommunications system, supports only packet-switched transmission, and tends to simplify the system structure and reduce transmission delay, so as to enhance transmission rate.
In the LTE system, upon a handover the RLC (Radio Link Control) layer in a user equipment (UE) is allowed to deliver out-of-sequence PDUs (Protocol Data Units) from a source base station to the PDCP layer. The PDCP (Packet Data Convergence Protocol) layer is an upper layer of the RLC layer, and is used for deciphering the PDUs, to avoid user data and certain signaling information being stolen. The out-of-sequence delivery means that packets are delivered to an upper layer out of order of sequence numbers.
Generally, decryption in the wireless communication system depends on a security parameter set, which includes a key and other parameters or variables, such as a count value, a bearer identity, and directions of packets. A UE utilizes a specified algorithm to decipher the cipher-text data according to the security parameter set, to generate the plain-text data.
The count value is composed of a receiver HFN (hyper frame number) and an SN (sequence number) embedded in the header of a packet. HFN is similar to the carrying number of SN. Each time SN wraps around its maximum representing value back to 0, HFN is incremented by one. For example, if SN is represented by 7 bits, which counts from 0 to 127, once SN is beyond 127, HFN is incremented by 1, and SN restarts from 0. As a result, according to SN, a sender and a receiver can timely increment HFN, so as to keep synchronization of HFN and maintain ciphering and deciphering process. Moreover, before deciphering packets, the PDCP layer compares SN embedded in a header of a packet with next expected PDCP receiver sequence number (Next_PDCP_RX_SN) maintained in the PDCP layer. If SN is smaller than Next_PDCP_RX_SN, it means that SN is beyond 127, and has to be restarted from 0. Therefore, the receiver HFN (RX_HFN) is incremented by 1, to keep synchronization with the sender. The above description shows that the PDCP layer needs to maintain a Next_PDCP_RX_SN and a RX_HFN for deciphering packets.
According to the prior art, upon handover a deciphering process in the PDCP layer of the UE operating in an Unacknowledged Mode (UM) of the RLC layer resets the security variables, namely a Next_PDCP_RX_SN and a RX_HFN, and then deciphers packets received from the source base station. Resetting the Next_PDCP_RX_SN and the RX_HFN is needed due to key change in the target base station.
However, these packets are ciphered by the source base station before handover utilizing a count value generated by security variables which are not reset, while the UE utilizes the reset security variables to decipher packets during handover. In this situation, the UE cannot decipher packets received from the source base station correctly. For example, a UE and a source base station process a streaming media broadcast service (a service in UM). At beginning of handover, HFNs in the source base station and the UE (i.e. TX_HFN and RX_HFN) are both “120” for generating a count value to cipher and decipher packets. Just before handover, parts of the packets are stored in the RLC layer due to out of sequence. Upon handover, these out-of-sequence packets are delivered to the PDCP layer. Before these packets are deciphered, the UE resets the Next_PDCP_RX_SN and the RX_HFN to “0” according to a handover process of the prior art. As a result, when deciphering packets, the RX_HFN utilized by the UE is different from the TX_HFN utilized by the source base station for deciphering the packets. Therefore, the packets cannot be deciphered correctly. In this situation, though these packets are deciphered and sent to an upper layer, incorrect deciphered data will cause error in media broadcast image, and affect the service quality.
Therefore, in the prior art, since the reset security variables are different from the security variables utilized by the source base station for ciphering packets, a user equipment upon handover will encounter a situation of deciphering failure or deciphering packets into invalid data when deciphering the packets received from the source base station.